<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.empodetail.main_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('attprice')">
                <el-table-column show-overflow-tooltip :prop="'attprice'" :label="$t('entities.empodetail.main_grid.columns.attprice')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.attprice')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.attprice" tag='EMATTPRICE' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('shf')">
                <el-table-column show-overflow-tooltip :prop="'shf'" :label="$t('entities.empodetail.main_grid.columns.shf')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.shf')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.shf"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('orderflag')">
                <el-table-column show-overflow-tooltip :prop="'orderflag'" :label="$t('entities.empodetail.main_grid.columns.orderflag')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.orderflag')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.orderflag}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('poname')">
                <el-table-column show-overflow-tooltip :prop="'poname'" :label="$t('entities.empodetail.main_grid.columns.poname')" :width="200"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.poname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='empo' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'empoedit-view9', height: 0,width: 0,title: $t('entities.empo.views.editview9.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'empos', parameterName: 'empo' },
            { pathName: 'editview9', parameterName: 'editview9' }
            ]}" valueitem="poid">
                            <span>{{row.poname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemname')">
                <el-table-column show-overflow-tooltip :prop="'itemname'" :label="$t('entities.empodetail.main_grid.columns.itemname')" :width="240"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.itemname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emitem' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emitem-tab-exp-view', height: 0,width: 0,title: $t('entities.emitem.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            ]
            ,parameters: [
            { pathName: 'emitems', parameterName: 'emitem' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="itemid">
                            <span>{{row.itemname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('podetailstate')">
                <el-table-column show-overflow-tooltip :prop="'podetailstate'" :label="$t('entities.empodetail.main_grid.columns.podetailstate')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.podetailstate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.podetailstate" tag='EMPODETAILSTATE' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('price')">
                <el-table-column show-overflow-tooltip :prop="'price'" :label="$t('entities.empodetail.main_grid.columns.price')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.price')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.price"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('psum')">
                <el-table-column show-overflow-tooltip :prop="'psum'" :label="$t('entities.empodetail.main_grid.columns.psum')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.psum')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.psum"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('totalprice')">
                <el-table-column show-overflow-tooltip :prop="'totalprice'" :label="$t('entities.empodetail.main_grid.columns.totalprice')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.totalprice')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.totalprice"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('unitrate')">
                <el-table-column show-overflow-tooltip :prop="'unitrate'" :label="$t('entities.empodetail.main_grid.columns.unitrate')" :width="72"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.unitrate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.unitrate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('civo')">
                <el-table-column show-overflow-tooltip :prop="'civo'" :label="$t('entities.empodetail.main_grid.columns.civo')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.civo')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.civo}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rdate')">
                <el-table-column show-overflow-tooltip :prop="'rdate'" :label="$t('entities.empodetail.main_grid.columns.rdate')" :width="97"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.rdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.rdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rsum')">
                <el-table-column show-overflow-tooltip :prop="'rsum'" :label="$t('entities.empodetail.main_grid.columns.rsum')" :width="61"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.rsum')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.rsum"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('runitname')">
                <el-table-column show-overflow-tooltip :prop="'runitname'" :label="$t('entities.empodetail.main_grid.columns.runitname')" :width="65"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.runitname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='pfunit' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'pfunitedit-view', height: 0,width: 500,title: $t('entities.pfunit.views.editview.title'),placement: 'DRAWER_RIGHT', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'pfunits', parameterName: 'pfunit' },
            { pathName: 'editview', parameterName: 'editview' }
            ]}" valueitem="runitid">
                            <span>{{row.runitname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rprice')">
                <el-table-column show-overflow-tooltip :prop="'rprice'" :label="$t('entities.empodetail.main_grid.columns.rprice')" :width="66"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.rprice')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.rprice"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('avgtsfee')">
                <el-table-column show-overflow-tooltip :prop="'avgtsfee'" :label="$t('entities.empodetail.main_grid.columns.avgtsfee')" :width="76"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.avgtsfee')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.avgtsfee"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('avgtaxfee')">
                <el-table-column show-overflow-tooltip :prop="'avgtaxfee'" :label="$t('entities.empodetail.main_grid.columns.avgtaxfee')" :width="66"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.avgtaxfee')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.avgtaxfee"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('amount')">
                <el-table-column show-overflow-tooltip :prop="'amount'" :label="$t('entities.empodetail.main_grid.columns.amount')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.amount')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.amount"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('wplistname')">
                <el-table-column show-overflow-tooltip :prop="'wplistname'" :label="$t('entities.empodetail.main_grid.columns.wplistname')" :width="80"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.wplistname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.wplistname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('rempname')">
                <el-table-column show-overflow-tooltip :prop="'rempname'" :label="$t('entities.empodetail.main_grid.columns.rempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.rempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.rempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('empname')">
                <el-table-column show-overflow-tooltip :prop="'empname'" :label="$t('entities.empodetail.main_grid.columns.empname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.empname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.empname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('description')">
                <el-table-column show-overflow-tooltip :prop="'description'" :label="$t('entities.empodetail.main_grid.columns.description')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.description')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.description}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('useto')">
                <el-table-column show-overflow-tooltip :prop="'useto'" :label="$t('entities.empodetail.main_grid.columns.useto')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.useto')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.useto" tag='EMUSETO' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('equipname')">
                <el-table-column show-overflow-tooltip :prop="'equipname'" :label="$t('entities.empodetail.main_grid.columns.equipname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.equipname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.equipname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('objname')">
                <el-table-column show-overflow-tooltip :prop="'objname'" :label="$t('entities.empodetail.main_grid.columns.objname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.objname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.objname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('equips')">
                <el-table-column show-overflow-tooltip :prop="'equips'" :label="$t('entities.empodetail.main_grid.columns.equips')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.equips')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.equips}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('updatedate')">
                <el-table-column show-overflow-tooltip :prop="'updatedate'" :label="$t('entities.empodetail.main_grid.columns.updatedate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.empodetail.main_grid.columns.updatedate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.updatedate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>